﻿namespace WebAppFilterDemo.InterfaceService
{
    public interface ISeasonTips
    {
        string Prompt(DateTimeOffset time);
    }

    public class SeasonTips : ISeasonTips
    {
        //根据不同月份提示季节注意事项
        public string Prompt(DateTimeOffset time) => time.Month switch
        {
            var h when h >= 3 && h <= 5 => "春天到了，早晚温差比较大，要注意别感冒。",
            var h when h >= 6 && h <= 8 => "夏天到了，天气炎热，要注意别防嗮。",
            var h when h >= 9 && h <= 11 => "秋天到了，天气干燥，要注意多喝水。",
            _ => "冬天到了，天气寒冷，要注意防寒保暖。"

        }; //END Prompt()  

    }
}
